package com.wx.jvm.classloader;

/**
 * 类加载器信息获取
 * @author wang.xun
 * @date 2023/08/11
 */
public class ClassLoaderInfo extends ClassLoader{
    public static void main(String[] args) throws InterruptedException {
        ClassLoaderInfo classLoader = new ClassLoaderInfo();

        System.out.println("自定义加载器：" +
                classLoader);
        System.out.println("自定义加载器的父类加载器：" +
                classLoader.getParent());
        System.out.println("Java程序系统默认的加载器：" +
                ClassLoader.getSystemClassLoader());
        System.out.println("拓展类加载器的父加载器：" +
                ClassLoader.getSystemClassLoader().getParent());
        System.out.println("Bootstrap加载器的父加载器："
                + ClassLoader.getSystemClassLoader().getParent().getParent());
        Thread.sleep(100000*100000);
    }

    int add(int a, int b) {
        int c = 1;
        int d = 1;

        return a + b;
    }
}
